﻿Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class FrontEnd_Control_hitCounter
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Bind2Grid()
        End If
    End Sub
    Protected Sub Bind2Grid()
        'Select Counter
        Using Data As New VSEntities
            Dim _Lang As Integer = 1
            If Not Session("LanguageId") Is Nothing Then
                _Lang = Session("LanguageId")
            End If
            'If _Lang = 2 Then
            '    Dim p = (From q In Data.Select_HitCounterEN Select q).ToList
            '    With rptHitCounter
            '        .DataSource = p
            '        .DataBind()
            '    End With
            'Else
            '    Dim p = (From q In Data.Select_HitCounter Select q).ToList
            '    With rptHitCounter
            '        .DataSource = p
            '        .DataBind()
            '    End With
            'End If
        End Using
    End Sub

    Protected Sub rptHitCounter_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptHitCounter.ItemDataBound
        Dim _Lang As Integer = 1
        If Not Session("LanguageId") Is Nothing Then
            _Lang = Session("LanguageId")
        End If
        'If _Lang = 2 Then
        '    Dim row As VSModel.Select_HitCounterEN_Result = CType(e.Item.DataItem, VSModel.Select_HitCounterEN_Result)
        '    Dim lblCounter As Literal
        '    lblCounter = CType(e.Item.FindControl("lblCounter"), Literal)
        '    lblCounter.Text = row.Title.ToString & "<span>" & row.Total.ToString & "</span>"
        'Else
        '    Dim row As VSModel.Select_HitCounter_Result = CType(e.Item.DataItem, VSModel.Select_HitCounter_Result)
        '    Dim lblCounter As Literal
        '    lblCounter = CType(e.Item.FindControl("lblCounter"), Literal)
        '    lblCounter.Text = row.Title.ToString & "<span>" & row.Total.ToString & "</span>"
        'End If
    End Sub
End Class
